package com.heima.user.feign;

import com.heima.common.dto.ResponseResult;
import com.heima.user.entity.ApAuthor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("leadnews-article")
public interface ArticleClient {

    /**
     * 新增文章作者
     * @param author
     * @return
     */
    @PostMapping("/api/v1/author")
    ResponseResult<ApAuthor> saveApAuthor (@RequestBody ApAuthor author);


    /**
     * 根据id查询作者信息
     * @param id
     * @return
     */
    @GetMapping("/api/v1/author/{id}")
    ResponseResult<ApAuthor> getAuthorById (@PathVariable("id") Integer id);
}
